package hashtables.Entries;

/**
 * A distribution element
 * @author Konstantin, Jan
 */
public class BucketDistributionEntry
{
    private int _index;
    private int _entries;
    
    /**
     * Creates a distribution element
     * @param index Index of the entry
     * @param count Number of entries in the bucket
     */
    public BucketDistributionEntry(int index, int entries)
    {
        _index = index;
        _entries = entries;
    }

    /**
     * Gets the index
     * @return The index
     */
    public int getIndex()
    {
        return _index;
    }

    /**
     * Gets the number of entries
     * @return value The number of entries
     */
    public int getNumEntries()
    {
        return _entries;
    }
    
    /**
     * Overrides the toString
     * @return The distribution
     */
    @Override public String toString()
    {
        return String.format("%5d: %7d", _index, _entries);
    }
}
